package com.hanlink.dsp.util;

import com.qztech.sdk.model.SettingConstants;

/**
 * @author Zhanghb
 * Email: 2573475062@qq.com
 * Date : 2019-12-22 16:29
 */
public class DspUtil {
    public static String processToQValue(int progress) {
        return String.valueOf((progress + SettingConstants.Q_MIN) / 100d);
    }

    public static String qToQValue(float q) {
        return String.valueOf(q / 100d);
    }

    public static int qToProcess(float q) {
        return (int) (q - SettingConstants.Q_MIN);
    }

    public static int processToQ(int process) {
        return process + SettingConstants.Q_MIN;
    }

    public static String gainToValue(int gain) {
        return String.valueOf((gain + SettingConstants.GAIN_MIN) / 10f);
    }

    public static int valueToGain(int value) {
        return value * 10 - SettingConstants.GAIN_MIN;
    }
}
